cmake_minimum_required(VERSION 3.10)

project(GateServer LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#开启调试模式
set(CMAKE_BUILD_TYPE Debug)



set(BOOST_ROOT "/usr/local/hslDir/mylib/boost")

find_package(Boost REQUIRED COMPONENTS system thread)


#引入gRPC与protobuf
find_package(protobuf CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)


file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc)



add_executable(GateServer GateServer.cc ${SOURCES})



#引入jsoncpp头文件
target_include_directories(GateServer PRIVATE /usr/local/include/jsoncpp/)
#引入jsoncpp库
target_link_libraries(GateServer  PRIVATE /usr/local/lib/libjsoncpp.a)

#引入include目录下的头文件
target_include_directories(GateServer PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)


#引入Boost Asio
target_link_libraries(GateServer PRIVATE Boost::system)

target_link_libraries(GateServer PRIVATE protobuf::libprotobuf gRPC::grpc++ gRPC::grpc++_reflection)

#引入Redis头文件
target_include_directories(GateServer PRIVATE /usr/local/include/redis/)
#引入Redis库
target_link_libraries(GateServer PRIVATE /usr/local/lib/libhiredis.a)

#引入mysql头文件
target_include_directories(GateServer PRIVATE /usr/include/)
#引入mysql库
target_link_libraries(GateServer PRIVATE /usr/lib/x86_64-linux-gnu/libmysqlcppconn.a -lmysqlclient)

